﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="BlackList.aspx.cs" Inherits="MadeInPortugalWebApplication.blackList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderHeadTitle" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="UserContentPlaceHolder" runat="server">
</asp:Content>
<%--<asp:Content ID="Content4" ContentPlaceHolderID="NavidationPlaceholder" runat="server">
</asp:Content>--%>

<asp:Content ID="Content7" ContentPlaceHolderID="ContentPlaceHolderNavigation" runat="server">
    <nav>
		<ul >				
			<li><a href="AdminProductList.aspx"><span>Diretório</span></a></li>						
			<li><a href="users.aspx"><span>Utilizadores</span></a></li>
			<li class="active"><a href="blacklist.aspx"><span>Blacklist</span></a></li>
            <li><a href="Properties.aspx"><span>Propriedades</span></a></li>
		</ul>			
	</nav>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<section id="page">
    <asp:UpdatePanel runat="server" ID="directoryUpdatePanel" UpdateMode="Conditional">
    
        <ContentTemplate>
            <div class="blacklist list">
                <h2 class="pageTitle">
                    BlackList</h2>
                <ul class="actions">
                    <li><a href="form.html" class="add addBlackListItemButton"><span><b></b>Adicionar termo</span></a></li>
                </ul>
                <div class="feedback">
                    <div runat="server" id="feedbackPanel">
                    </div>
                </div>
                <div class="blackListAddPanel disabled">
                    <h4>
                        Adicionar Termo</h4>
                    <div class="form">
                        <p>
                            <label class="inline">
                                Termo
                            </label>
                            <asp:TextBox runat="server" ID="tbxNewTerm" Columns="60" MaxLength="50" />
                        </p>
                        <p class="buttons">
                            <asp:LinkButton CssClass="button" runat="server" ID="btnSaveNewTerm" OnClick="SaveNewTerm_Click">
                                <span>Adicionar</span>
                            </asp:LinkButton>
                            <span>ou</span> <a href="#" class="cancel">Cancelar</a>
                        </p>
                    </div>
                </div>
                <div class="advancedBackListOptions blackListFilter closed">
                    <h4>
                        <b></b>Pesquisa</h4>
                    <div class="form filter">
                        <p>
                            <label class="inline">
                                Termo
                            </label>
                            <input type="text" size="60" maxlength="500" />
                        </p>
                        <p class="buttons">
                            <a href="#" class="button"><span>Pesquisar</span></a> <a href="#" class="button cancel">
                                <span>Limpar</span></a>
                        </p>
                    </div>
                </div>
                <asp:GridView ID="blacklistGridView" runat="server" AutoGenerateColumns="False" DataKeyNames="ID"
                    OnRowCommand="GridView_RowCommand" CssClass="matrix" GridLines="None" >
                    <Columns>
                        <asp:TemplateField HeaderText="Número" SortExpression="ID" Visible="false">
                            <ItemTemplate>
                                <asp:Label ID="lbNumber" runat="server" Text='<%# Eval("ID")%>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Termo" ItemStyle-CssClass="input">
                            <ItemTemplate>
                                <asp:Label ID="lbTerm" CssClass="value" runat="server" Text='<%# Eval("Term")%>' />
                                <asp:TextBox ID="tbxTerm" runat="server" Text='<%# Eval("Term")%>' Columns="100"
                                    maxlenght="200" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ItemStyle-CssClass="actions" HeaderStyle-CssClass="actions threeactions">
                            <ItemTemplate>
                                <asp:LinkButton ID="btnTermSave" runat="server" CssClass="action save disabled" Text="Guardar" CommandName="saveBlacklist" CommandArgument='<%# DataBinder.Eval(Container, "RowIndex") %>' />
                                <a href="#" class="action edit">Editar</a>
                                <asp:LinkButton ID="btnTermDelete" runat="server" CssClass="action delete" Text="Eliminar" CommandName="deleteBlacklist" CommandArgument='<%# DataBinder.Eval(Container, "RowIndex") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
                <asp:HiddenField runat="server" ID="hfPageNumber" Value="1" />
                <ul id="pagination">
                    <asp:Repeater runat="server" ID="paginationList" OnItemCommand="RepeaterChangePage_Command">
                        <HeaderTemplate>
                            <li>Página</li>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <li class='<%# DataBinder.Eval(Container.DataItem, "Class") %>'>
                                <asp:LinkButton runat="server" ID="paginationItem" Text='<%# DataBinder.Eval(Container.DataItem, "PageNumber") %>'
                                    CommandName="goPage" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "PageNumber") %>' />
                            </li>
                        </ItemTemplate>
                    </asp:Repeater>
                </ul>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    </section>
</asp:Content>
